﻿using System;
using System.Text;

namespace DecimalToHexadecimal
{
    class DecimalToHexadecimal
    {
        static char GetSymbol(int number)
        {
            if (number > 9)
            {
                return (char)(55 + number); // 55 + 10 = 65 in ASCII = 'A'
            }
            return (char)(number + '0');
        }
        static string ConvertDecimalToHexadecimal(int number)
        {
            StringBuilder result = new StringBuilder();
            for (int num = number; num > 0; num /= 16)
            {
                result.Insert(0, GetSymbol(num % 16));
            }
            return result.ToString();
        }
        static void Main(string[] args)
        {
            Console.WriteLine(ConvertDecimalToHexadecimal(6531564));
        }
    }
}
